//
//  ZMNavController.swift
//  LoveBeen
//
//  Created by pg on 2017/8/6.
//  Copyright © 2017年 pg. All rights reserved.
//

import UIKit

class ZMNavController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

      
    }
    

    //重写导航控制器的push方法
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        super.pushViewController(viewController, animated: true)
        
        //跳入非跟控制器的时候隐藏底部导航
        if viewControllers.count > 1{
            
          
           viewController.hidesBottomBarWhenPushed = true
        }
       
    }

    
//    override func popViewController(animated: Bool) -> UIViewController? {
//        
//      //  print(viewControllers.count)
//        
//        super.popViewController(animated: true)
//        
//        
//        
//        return
//    }
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
